<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<p id="p1">hello word!</p>
		<p id="p2">hello word!</p>
		<button onclick="p1()">点我改变第二个p标签</button>
		
		<script>
			document.getElementById("p1").style.color = "red";
			
			function p1(){
				document.getElementById("p2").style.color = "blue";
				document.getElementById("p2").style.backgroundColor = "red";
			}
		</script>
	</body>
</html>